package com.witframework.web.tag.menuwordtag;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyContent;
import javax.servlet.jsp.tagext.BodyTagSupport;

public class TextTag extends BodyTagSupport{
  public int doAfterBody()   throws JspException {
    String str;
    MenuWordTag localMenuWordTag = (MenuWordTag)findAncestorWithClass(this, MenuWordTag.class);
    if (localMenuWordTag == null)
      throw new JspException("Could not find ancestor MenuWord");
    BodyContent localBodyContent = getBodyContent();
    if (localBodyContent == null)
      str = "";
    else
      str = localBodyContent.getString();
    localMenuWordTag.setText(str.trim());
    if (localBodyContent != null)
      localBodyContent.clearBody();
    return 0;
  }

  public int doEndTag()
    throws JspException
  {
    dropData();
    return 6;
  }

  public void release()
  {
    dropData();
  }

  private void dropData()
  {
  }
}